﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IServer.protobuf
{


    [Serializable]
    public enum MsgType
    {

        Login = 0,
        Register, //首次登录
        FriendEvent, //成员列表
        Logout,
        LostConnection, //掉线
        LostReconnect, //掉线 重新连接
        Chat,
    }


    [Serializable]
    public class MsgData
    {
        public string caller { get; set; }  //ID
        public string[] receiver { get; set; }//接收者
        public MsgType type { get; set; } //类型
        public string data { get; set; } //数据流
    }

    [Serializable]
    public class UserInfo
    {
        public string name { get; set; }  //client set, 姓名
        public string ID { get; set; } //server set,  唯一凭证
        public int state { get; set; } //server set, 状态  2 online

        [NonSerialized]
        public int index = -1;//聊天列表下标
    }

    [Serializable]
    public class login_success_result
    {
        public UserInfo info { get; set; }
        public UserInfo[] friends { get; set; }
        public List<chat_data> message { get; set; }
    }

    [Serializable]
    public class register_success_result : login_success_result { }

    [Serializable]
    public class chat_data
    {
        public string from { get; set; }  //从某某ID发起
        public string chatContent { get; set; } //内容
        public string ts { get; set; } //时间戳
    }

}
